﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using FilStartUps_Mobile.Helpers;

namespace FilStartUps_Mobile.Models
{
    public class Member
    {
        [Key]
        public int memberidPK { get; set; }

        public string emailaddress { get; set; }

        [Column]
        public string confirmemailaddress { get; set; }

        [Column]
        public string password { get; set; }

        [Column]
        public string confirmpassword { get; set; }

        [Column]
        public bool member_flag { get; set; }

        public int roleidFK { get; set; }

        [Column]
        public DateTime datejoined { get; set; }

        [Column]
        public string validationcode { get; set; }

        [Column]
        public string secretanswer { get; set; }

        [Column]
        public string secretquestion { get; set; }

    }
    public class LogOnModel
    {
        [Display(Name="Email Address")]
        [DataType(DataType.EmailAddress)]
        [Required(ErrorMessage="Email Address is required")]
        public string emailaddress { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Password")]
        [Required(ErrorMessage="Password is required")]
        public string password { get; set; }
    }
    public class RegistrationModel
    {
        [Display(Name="Email Address")]
        [Required(ErrorMessage="*")]
        public string emailaddress { get; set; }

        [Mandatory(ErrorMessage = "Please accept FilStartUps! User Agreement.")]
        [Display(Name = "Terms")]
        public bool isTermAccepted { get; set; }

        [Display(Name="Confirm Email Address")]
        [Required(ErrorMessage = "*")]
        public string confirmemailaddress { get; set; }
        
        [Display(Name="Password")]
        [DataType(DataType.Password)]
        [Required(ErrorMessage = "*")]
        public string password { get; set; }

        [Required(ErrorMessage = "*")]
        [Display(Name="Confirm Password")]
        [DataType(DataType.Password)]
        public string confirmpassword { get; set; }

        [Required(ErrorMessage = "*")]
        [Display(Name="Firstname")]
        [RegularExpression("^([a-zA-Z ]*[a-zA-Z][a-zA-Z0-9 ]*)$",
                       ErrorMessage="Special Characters is not allowed")]
        public string firstname { get; set; }


        [Display(Name="Lastname")]
        [Required(ErrorMessage = "*")]
        [RegularExpression("^([a-zA-Z ]*[a-zA-Z][a-zA-Z0-9 ]*)$" ,
                ErrorMessage="Special Characters is not allowed")]
        public string lastname { get; set; }

    }
}